/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.teach.service;

import java.util.Date;
import java.util.List;

import com.lczyfz.istep.common.constants.DeleteFlag;
import com.lczyfz.istep.modules.teach.entity.TeachExam;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lczyfz.istep.common.persistence.Page;
import com.lczyfz.istep.common.service.CrudService;
import com.lczyfz.istep.modules.teach.entity.TeachStudentExam;
import com.lczyfz.istep.modules.teach.dao.TeachStudentExamDao;

/**
 * 学生_考试中间表Service
 * @author cqh
 * @version 2017-06-15
 */
@Service
@Transactional(readOnly = true)
public class TeachStudentExamService extends CrudService<TeachStudentExamDao, TeachStudentExam> {

	@Autowired
	TeachStudentExamDao teachStudentExamDao ;

	public TeachStudentExam get(String id) {
		return super.get(id);
	}

	public List<TeachStudentExam> findList(TeachStudentExam teachStudentExam) {
		return super.findList(teachStudentExam);
	}

	public Page<TeachStudentExam> findPage(Page<TeachStudentExam> page, TeachStudentExam teachStudentExam) {
		return super.findPage(page, teachStudentExam);
	}

	@Transactional(readOnly = false)
	public void save(TeachStudentExam teachStudentExam) {
		super.save(teachStudentExam);
	}

	@Transactional(readOnly = false)
	public void delete(TeachStudentExam teachStudentExam) {
		super.delete(teachStudentExam);
	}


	public List<TeachExam> findAnswerTimeByExamId(String examId){
		return teachStudentExamDao.findAnswerTimeByExamId(examId, DeleteFlag.deleteFlag);
	}
	public List<TeachStudentExam> findFirstTimeAndCountByExamId(String examId,String userId){
		return teachStudentExamDao.findFirstTimeAndCountByExamId(examId,userId, DeleteFlag.deleteFlag);
	}

	@Transactional(readOnly = false)
	public void setFirstTimeByExamId(String examId,String userId,Date endDate){
		teachStudentExamDao.setFirstTimeByExamId(examId,userId, endDate);
	}

	@Transactional(readOnly = false)
	public void setexamFrequencyByExamId(String examId,String userId,String examFrequency){
		teachStudentExamDao.setexamFrequencyByExamId(examId, userId, examFrequency);
	}

}